<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" > 

<html>
<head>
<base href="<%=basePath%>">
<title>疾病导入</title>
<link rel="stylesheet" href="./js/bootstrap-3.3.5-dist/css/bootstrap.css" type="text/css"/>
<link rel="stylesheet" href="./js/metisMenu/metisMenu.min.css">
<link rel="stylesheet" href="./css/sb-admin/sb-admin-2.css">
<link rel="stylesheet" href="./css/base.css">
<link rel="stylesheet" href="./css/illness.css">
<link rel="stylesheet" href="./js/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="./js/bootstrap-table/bootstrap-table.min.css">
<link rel="stylesheet" href="./js/bootstrap-multiselect/bootstrap-multiselect.css" type="text/css"/>
<link rel="stylesheet" href="./js/bootstrap-3.3.5-dist/css/bootstrap-datetimepicker.css">

<script type="text/javascript" src="./js/jquery-2.1.1.js"></script>
<script type="text/javascript" src="./js/bootstrap-3.3.5-dist/js/bootstrap.js"></script>
<script type="text/javascript" src="./js/metisMenu/metisMenu.js"></script>
<script type="text/javascript" src="./js/common.js"></script>
<script src="./js/bootstrap-table/bootstrap-table-all.min.js"></script>
<script src="./js/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>
<script src="./js/bootstrap-multiselect/bootstrap-multiselect.js"></script>
<script src="./js/bootstrap-jquery-plugin/jquery.bootstrap.js"></script>
<script src="./js/bootstrap-3.3.5-dist/js/bootstrap-datetimepicker.js"></script>
<script src="./js/bootstrap-3.3.5-dist/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="./js/ajaxfileupload.js"></script>
<style type="text/css">
.fileinput-button {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.fileinput-button input{
    position:absolute;
    right: 0px;
    top: 0px;
    opacity: 0;
    -ms-filter: 'alpha(opacity=0)';
    font-size: 200px;
}
.btn-upload{
    border: 1px solid #efefef;
    border-radius: 6px;
    padding: 8px;
    color: #fff;
    background-color: #04be02;
}
</style>
</head>
<body>
	<jsp:include page="../template/head.jsp" />
	<jsp:include page="../template/leftnav.jsp" />
	<div id="page-wrapper">
		<div class="wrapper">
			<h1>疾病导入</h1>
		</div>
		<div class="bHead">
			<ul class="list-inline">	
				<li>
					<label>疾病导入：</label>
<!-- 						<form action="./illOper/importExcel.spring" method="POST" enctype="multipart/form-data">
						<form enctype="multipart/form-data">  
			            <input type="file" name="file" id="file" style="display: none;" onchange="document.getElementById('filePath').value=this.value">
			             <div class="input-group" style="position:absolute;left:0;top:0;width:100px;height:100px;z-index:999;opacity:0;">
			                    <input type="'text'" name="'filePath'" id="'filePath'" class="'form-control'/"> 
						</div>
						<span>
							<button type="button" class="btn btn-sm btn-info blue" id="btn_check">
								<i class="icon-edit">选择</i>
							</button>
						</span>
			             <button type="submit" class="btn btn-sm btn-info" id="upload">
			                 <i class="upload-icon icon-cloud-upload bigger-110">导入</i>
			             </button>
				    </form> -->
				    
<!-- 				    <p><input type="file" id="file1" name="file" /></p>
				    <input type="button" value="上传" /> -->
				    <div align="center">
				        <span class="btn fileinput-button btn-upload" >
				            <span>选择</span>
				            <input type="file" id="file1" name="file" />
				        </span>
				        <span class="btn fileinput-button btn-upload">
				            <span>上传</span>
				            <input type="button" value="上传" />
				        </span>
				    </div>
				</li>
			</ul>
		</div>	
	</div>	
</body>
<script type="text/javascript">

$(function () {
    $(":button").click(function () {
        ajaxFileUpload();
    })
});
function ajaxFileUpload(){
    $.ajaxFileUpload({
            url: "./illOper/importExcel",
            secureuri: false, 
            fileElementId: 'file1', 
            dataType: 'json', 
            success: function (data, status){
				$.messager.popup(data.msg);
            },
            error: function (data, status, e){
                alert(e);
            }
        }
    )
    return false;
}


/* $(function (){
		$("#btn_check").click(function() {
			$("#file").trigger('click');
		});
		$("#filePath").click(function() {
			$("#file").trigger('click');
		});
		
		$('form').on('submit',function(e){
		    e.preventDefault();
		    $.ajax({
		        type:"POST",
		        url:"./illOper/importExcel",
		        data:{},
		        success:function (data) {
		            console.info("返回值:",data);
		        }
		    });
		});
}); */
</script>
</html>
